package com.csti.delio.pagos.client.contratos;

import java.util.Date;

import com.csti.delio.main.client.idioma.DelioConstants;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.form.HiddenField;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.core.client.GWT;

public class PanelNuevoContrato extends FieldSet {
private DelioConstants k=GWT.create(DelioConstants.class);	
private HiddenField<String> id;	
@SuppressWarnings("rawtypes")
private SimpleComboBox cmbTipoContrato;//ComboBox<BeanModel>
private SimpleComboBox cmbFormapago;
private SimpleComboBox cmbTipoEmpleo;
private SimpleComboBox cmbCargo;
private TextField<String> txtDuracion;
private TextField<String> txtNumero;
private NumberField txtSueldo;
private DateField fechainicio;
	
public PanelNuevoContrato(){
	super();
	setHeading(k.contrato());
	setCollapsible(false);
	setLayout(new ColumnLayout());
	
	id=new HiddenField<String>();
	
		    
	cmbTipoContrato=new SimpleComboBox();
	cmbTipoContrato.setFieldLabel(k.tipocontrato());
	cmbTipoContrato.setDisplayField("cargo");
	cmbTipoContrato.setAllowBlank(false);

	
	cmbFormapago=new SimpleComboBox();
	cmbFormapago.setFieldLabel(k.formapago());
	cmbFormapago.setAllowBlank(false);
	
	cmbTipoEmpleo=new SimpleComboBox();
	cmbTipoEmpleo.setFieldLabel(k.tipoempleo());
	cmbTipoEmpleo.setAllowBlank(false);
	
	cmbCargo=new SimpleComboBox();
	cmbCargo.setFieldLabel(k.cargo());
	cmbCargo.setAllowBlank(false);
	
	txtDuracion=new TextField<String>();
	txtDuracion.setAllowBlank(false);
	txtDuracion.setFieldLabel(k.duracion());
	
	
	txtNumero=new TextField<String>();
	txtNumero.setAllowBlank(false);
	txtNumero.setFieldLabel(k.numero());
	
	txtSueldo=new NumberField();
	txtSueldo.setFieldLabel(k.sueldo());
	txtSueldo.setAllowBlank(false);
	txtSueldo.setPropertyEditorType(Double.class);
	
	fechainicio=new DateField();
	fechainicio.setAllowBlank(false);
	fechainicio.setFieldLabel(k.fechainicio());
	fechainicio.setValue(new Date());
	
	LayoutContainer lc1=new LayoutContainer();
	lc1.setLayout(new FormLayout(LabelAlign.TOP));
	lc1.add(cmbTipoContrato,new FormData("90%"));
	
	LayoutContainer lc2=new LayoutContainer();
	lc2.setLayout(new FormLayout(LabelAlign.TOP));
	lc2.add(txtNumero,new FormData("92%"));
	
	
	LayoutContainer lc3=new LayoutContainer();
	lc3.setLayout(new FormLayout(LabelAlign.TOP));
	lc3.add(txtSueldo,new FormData("90%"));
	
	LayoutContainer lc4=new LayoutContainer();
	lc4.setLayout(new FormLayout(LabelAlign.TOP));
	lc4.add(cmbFormapago,new FormData("95%"));
	
	
	LayoutContainer lc5=new LayoutContainer();
	lc5.setLayout(new FormLayout(LabelAlign.TOP));
	lc5.add(cmbCargo,new FormData("97%"));
	
	LayoutContainer lc6=new LayoutContainer();
	lc6.setLayout(new FormLayout(LabelAlign.TOP));
	lc6.add(txtDuracion,new FormData("94%"));
	
	LayoutContainer lc7=new LayoutContainer();
	lc7.setLayout(new FormLayout(LabelAlign.TOP));
	lc7.add(fechainicio,new FormData("92%"));
	
	LayoutContainer lc8=new LayoutContainer();
	lc8.setLayout(new FormLayout(LabelAlign.TOP));
	lc8.add(cmbTipoEmpleo,new FormData("97%"));
	
	add(lc1,new ColumnData(.6));
	add(lc2,new ColumnData(.4));
	add(lc5,new ColumnData(1));
	add(lc3,new ColumnData(.4));
	add(lc4,new ColumnData(.6));
	add(lc8,new ColumnData(1));
	add(lc7,new ColumnData(.5));
	add(lc6,new ColumnData(.5));
	
	
	
}


}
